#ifndef AssetModel_H
#define AssetModel_H

#include <QtGui>
#include <QAction>

#include "..\core\src\AssetManager.h"
#include "ModelItems/TreeItem.h"
#include "ResultModel.h"

class QMenuBar;
class QMainWindow;
class QDockWidget;
class QToolbar;

namespace Xps
{
	class SelectorModel;

	class AssetModel : public QStandardItemModel
	{
		Q_OBJECT


	public:	

		QStandardItem *rootItem;
		XpsAssets::AssetManager* am;
		QMap<int, TreeItem*> questions;
		QMap<int, TreeItem*> results;
		QMap<int, TreeItem*> attributes;
		QMap<int, TreeItem*> responses;	

		TreeItem *questionsRootItem;
		TreeItem *attributesRootItem;
		TreeItem *resultsRootItem;

		SelectorModel* qm;
		SelectorModel* attributesModel;
		
		AssetModel(XpsAssets::AssetManager* am);
		void init();
		void clear();
		
	public slots:
		void addQuestion(int);
		void addResult(int);
		void addAttribute(int);
		void addResponseAttribute(int,int);
		void remResponseAttribute(int,int);
		void remQuestion(int);
		void remResult(int);
		void remResponse(int,int);
		void remAttribute(int);
		void addResponse(int,int);
	};
}
#endif